package com.zhlab.ssm.demo.web.controller;

import com.zhlab.ssm.demo.web.model.SysAdminUser;
import com.zhlab.ssm.demo.web.service.SysAdminUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @ClassName TestController
 * @Description //TestController
 * @Author singleZhang
 * @Email 405780096@qq.com
 * @Date 2021/1/18 0018 下午 4:05
 **/

@Controller
@RequestMapping("/")
@ControllerAdvice
public class TestController {

    @Autowired
    SysAdminUserService sysAdminUserService;

    @GetMapping("/test")
    public String test(){
        System.out.println("this is a test demo !");
        return "test";
    }

    @GetMapping("/userList")
    @ResponseBody
    public List<SysAdminUser> list(){
        return sysAdminUserService.selectAll(new SysAdminUser());
    }

}
